package com.xbfinal.servicebase;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.service.Contact;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

import java.util.ArrayList;

@Configuration//配置类
@EnableSwagger2//开启Swagger配置
public class SwaggerConfig {

    //1.Swagger实例Bean是Docket，

    @Bean
    public Docket docket(){
        return new Docket(DocumentationType.SWAGGER_2).apiInfo(apiInfo());
    }

    //配置文档信息
    private ApiInfo apiInfo() {
        //作者信息
        final Contact contact = new Contact(
                "笑霸fianl",
                "https://blog.csdn.net/weixin_52062043",
                "358863605@qq.com"
        );
        return new ApiInfo(
                "笑霸final",//标题
                "加油少年",//描述
                "v1.0.0",//版本
                "https://blog.csdn.net/weixin_52062043",//服务条款网站
                contact,
                "Apche 2.0",//许可证
                "https://blog.csdn.net/weixin_52062043",//许可网址
                new ArrayList()
        );
    }
}

